package com.pizza.abstrait;

import java.io.Serializable;

import com.pizza.model.Diametre;
import com.pizza.model.Pizza;

/**
 * Class AbstractPizzaDiametre, qui regroupe le diametre et le prix d'une pizza.
 *
 */
public class AbstractPizzaDiametre implements Serializable {

	protected Diametre diametre;

	protected float prix;
	
	public AbstractPizzaDiametre(Diametre diametre, float prix) {
		super();
		this.diametre = diametre;
		this.prix = prix;
	}

	public Diametre getDiametre() {
		return diametre;
	}

	public void setDiametre(Diametre diametre) {
		this.diametre = diametre;
	}

	public float getPrix() {
		return prix;
	}

	public void setPrix(float prix) {
		this.prix = prix;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if ((obj == null) || (obj.getClass() != this.getClass()))
			return false;
		AbstractPizzaDiametre p = (AbstractPizzaDiametre) obj;
		return (diametre.getId() == p.getDiametre().getId() && prix == p.getPrix());
	}

	
}
